home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-02-08 | 1.3 KB | 44 lines | [TEXT/PJMM] |
- {****************************}
- {}
- { Non-Standard File Test}
- { Created by Steve Sheets}
- {}
- { Examples of using NonStandardFile unit.}
- {}
- {****************************}
-
- program NonStandardFileTest;
-
- uses
- NonStandardFile;
-
- var
- gGood: BOOLEAN;
- gRefNum: INTEGER;
- gFileName: Str255;
- gType: OSType;
- gTypeList: SFTypeList;
- gNameList: array[0..1] of Str255;
- gFlag: BOOLEAN;
- gNum: INTEGER;
- gIcon1, gIcon2, gIcon3: Handle;
-
- begin
- NSPutFile('Please enter the name of the file you wish to save:', 'File Name', gGood, gRefNum, gFileName);
-
- NSSelectPutFile('Save copy of Document to disk:', 'Save copy of Selection to disk:', 'File Name', gGood, gRefNum, gFileName, gFlag);
-
- gTypeList[0] := 'TEXT';
- gNameList[0] := 'Text files';
- gTypeList[1] := 'PNTG';
- gNameList[1] := 'MacPaint files';
- NSGetFile('Please select a file:', 2, @gTypeList, @gNameList, gGood, gRefNum, gFileName, gType);
-
- gIcon1 := GetResource('ICN#', 1000);
- gIcon2 := GetResource('ICN#', 1001);
- gIcon3 := GetResource('ICN#', 1002);
- NSIconPutFile('Name', 1, gIcon1, gIcon2, gIcon3, nil, 'MacPaint', 'Text', 'PICT', '', 'Save copy file to MacPaint document:', 'Save file as Text document:', 'Save copy file to PICT document:', '', gGood, gRefNum, gFileName, gNum);
- ReleaseResource(gIcon1);
- ReleaseResource(gIcon2);
- ReleaseResource(gIcon3);
- end.